db.dropUser("product");

db.createUser({
  user: 'product',
  pwd: 'product_user_pass',
  roles: [
    {
      role: 'readWrite',
      db: 'product'
    }
  ]
});


db.product.update({
    productCode: "BOOK_GO"
}, {
    $set:{
        name:"GO入门",
        productCode: "BOOK_GO",
        group:"Program Language",
        price: 100
    }
}, {upsert:true});

db.product.update({
    productCode: "BOOK_JAVA"
},{
    $set:{
        name:"Java入门",
        productCode: "BOOK_JAVA",
        group:"Program Language",
        price: 102
    }
}, {upsert:true});

db.product.update({
    productCode: "BOOK_PYTHON"
},{
    name:"Python入门",
    productCode: "BOOK_PYTHON",
    group:"Program Language",
    price: 101
}, {upsert:true});